<div class="settings-block form-body" id="setting-security-upnp">
    <div class="form-title" data-trans="upnp_setting"></div>
    <div class="content">
        <div class="span4 side-right" data-trans="upnp_setting">UPnP Settings</div>
        <div class="span8">
            <input id="access_1" class="b-radio" type="radio" name="rangeGroup" value="1">
            <label for="access_1" data-trans="enable">enable</label>

            <input id="access_2" class="b-radio" type="radio" name="rangeGroup" value="0">
            <label for="access_2" data-trans="disable">disable</label>
        </div>
    </div>
    <div class="form-buttons">
        <input type="button" onclick="upnp_setUpnpSetting()" class="btn-1 btn-primary" data-trans="apply" />
    </div>
    <div class="form-note">
        <div class="notes-title">&nbsp;</div>
        <ul class="notes-content">
            <li data-trans="upnp_note_info"></li>
            <!--<li data-trans="lan_note"></li>-->
        </ul>
    </div>
</div>

<script>
    window.LTELanguageInitPart('#setting-security-upnp')

    function upnp_setUpnpSetting() {
        var range = $('input[name=rangeGroup]:checked').val()
        var params = {};
        params.upnpSetting = range;
        window._service.setUpnpSetting(params, function(result) {
            if (result.result == "success") {
                successOverlay();
            } else {
                errorOverlay();
            }
        });
    }

    function load_init() {
        var info = window._service.getUpnpSetting()
        $('input[name=rangeGroup][value=' + info.upnpSetting + ']').attr('checked', true)
    }
    load_init()
</script>